var mysql = require('mysql');
var conection = mysql.createConnection({
    host        :'localhost',
    port        :   "3306" ,
    user        :'root',
    password    :'root',
    database    :'juzao',
    multipleStatements:true
});

// connection.conect();
module.exports = (sql) =>{
    return new Promise(next =>{

        conection.query(sql,function (error, results, fields){
            if(error) throw error;
            ///console.log('The solution is: ', results[0].solution);
            next(results)
        });
        ///conection.end();
    })
}